package com.gzhryc.net_marketing.cloud.business.dao.db;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.annotaion.UniqueKey;
import com.gzhryc.net_marketing.core.enums.*;

import java.util.Date;

/**
 * 云商品订单，用于记录存档
 */
@Table(name = "cloud_goods_pay_order")
public class CloudGoodsPayOrder {

	@Id(auto = false)
	@Column(name = "trade_no", notNull = true,length = 32,note = "订单号")
	protected String tradeNo;

	@Column(name = "project_id", notNull = true, note = "商城项目ID")
	private Long projectId;

	@Column(name = "project_mame", notNull = true,note = "商城项目名称")
	protected String projectName;

	@UniqueKey
	@Column(name = "supplier_trade_no",length = 32, note = "供应商订单号")
	protected String supplierTradeNo;

	@Column(name = "supplier_id", notNull = true, note = "商品供应商ID")
	protected Long supplierId;

	@Column(name = "supplier_mame", notNull = true)
	protected String supplierName;

	@UniqueKey
	@Column(name = "pay_trade_No",length = 32, note = "支付订单号")
	private String payTradeNo;

	@Column(name = "money",notNull = true,note = "订单金额")
	private Integer money;

	//商品信息
	@Column(name = "goods_code", notNull = true)
	protected String goodsCode;

	@Column(name = "goods_name", notNull = true)
	protected String goodsName;

	//状态
	@Column(name="supply_state",notNull = true,defVal = "1",note="供货状态")
	protected Integer supplyState;

	@Column(notNull = true,defVal = "1")
	protected Integer state;

	@Column(name = "update_date", autoUpdateTime = true)
	protected Date updateDate;

	@Column(name = "create_date")
	protected Date createDate;

	public String getTradeNo() {
		return tradeNo;
	}

	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}

	public Long getProjectId() {
		return projectId;
	}

	public void setProjectId(Long projectId) {
		this.projectId = projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getSupplierTradeNo() {
		return supplierTradeNo;
	}

	public void setSupplierTradeNo(String supplierTradeNo) {
		this.supplierTradeNo = supplierTradeNo;
	}

	public Long getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(Long supplierId) {
		this.supplierId = supplierId;
	}

	public String getGoodsCode() {
		return goodsCode;
	}

	public void setGoodsCode(String goodsCode) {
		this.goodsCode = goodsCode;
	}

	public String getSupplierName() {
		return supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public String getPayTradeNo() {
		return payTradeNo;
	}

	public void setPayTradeNo(String payTradeNo) {
		this.payTradeNo = payTradeNo;
	}

	public Integer getMoney() {
		return money;
	}

	public void setMoney(Integer money) {
		this.money = money;
	}

	public Integer getSupplyState() {
		return supplyState;
	}

	public void setSupplyState(Integer supplyState) {
		this.supplyState = supplyState;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getStateName() {
		return GoodsOrderEnum.State.note(this.state);
	}

	public String getSupplyStateName(){
		return GoodsOrderEnum.SupplyState.note(this.supplyState);
	}

	public String getMoneyStr(){
		return NumberTools.getMoneyStr(money);
	}
}
